package com.tengju.data.domain.model.exchvesion;

import lombok.AllArgsConstructor;
import org.springframework.util.StringUtils;

@AllArgsConstructor
public enum DataName {

    ACHIEVEMENT_BONUS_LOG("achievement_bonus_log","市场指数小时任务"),
    REPORT_ACTIVITY_SALE_MONEY("report_activity_sale_money","66活动");

    private String code;
    private String desc;

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static DataName fromVal(String val) {
        if (StringUtils.isEmpty(val)) {
            return null;
        }
        for (DataName type : values()) {
            if (type.code == val) {
                return type;
            }
        }
        return null;
    }
}
